package cn.aj.ufallback;

import cn.aj.domain.User;
import cn.aj.feign.UserService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserServiceFall implements FallbackFactory<UserService> {
    @Override
    public UserService create(Throwable throwable) {
        return new UserService() {
            @Override
            public User loadUser(Long id) {
                return new User(-2L, "我是feign熔断", "我是feign熔断");
            }
        };
    }
}
